#!/bin/sh

## hyphop ##

#= post install base

PR=$(dirname $0)

. $PR/build.conf

opkg=$PR/opkg

echo "[i] install packages">&2

[ -d /tmp/opkg-lists ] || {
    echo "[i] opkg update">&2
    $opkg update
}

for p in /tmp/opkg-lists/openwrt_*; do
    [ -f $p ] || {
        echo "[i] opkg update">&2
	$opkg update
    }
    [ -s $p ] || {
        echo "[i] opkg update">&2
	$opkg update
    }
done


#    ppp-mod-pptp \
#    luci-proto-ppp \

# mountd
# avahi-daemon-service-ssh avahi-daemon-service-http \
# blockd

$opkg install rsync bwm-ng curl procps-ng-pkill tcpdump nano mc \
    fdisk sfdisk i2c-tools usbutils evtest netcat aria2 \
    shadow-useradd shadow-userdel shadow-usermod \
    gzip tar unzip unrar coreutils-dd coreutils-stat \
    inotifywatch inotifywait \
    coreutils-stty \
    avahi-dbus-daemon avahi-utils \
    mount-utils dosfstools e2fsprogs resize2fs blkid losetup dtc uboot-envtools \
    comgt luci-proto-3g usb-modeswitch usbreset \
    triggerhappy kmod-hid \
    iw wpad-wolfssl wpa-cli \
    wireless-tools iwinfo \
    iperf pv \
    ttyd \
    samba36-client cifsmount \
    nfs-utils \
    ppp-mod-pptp \
    iptables-mod-tproxy \
    iptables-mod-trace \
    ipset libpcre \
    wpan-tools wireguard luci-app-wireguard \
    pciutils 

#    openvpn-mbedtls luci-app-openvpn \
#    luci-app-https-dns-proxy \


#    shadowsocks-libev-ss-redir shadowsocks-libev-ss-local shadowsocks-libev-ss-rules shadowsocks-libev-config luci-app-shadowsocks-libev \

case $REL in
    18*)
    $opkg install zip

    ;;
    19*)
    echo ""
    $opkg install libzstd zstd
#   $opkg install mkf2fs f2fs-tools
    ;;
esac

